package org.example.service.impl;

import org.example.mapper.ClassAccountMapper;
import org.example.pojo.ClassAccount;
import org.example.service.ClassAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassAccountServiceImpl implements ClassAccountService {
    @Autowired
    private ClassAccountMapper classAccountMapper;


    @Override
    public void addClassAccount(ClassAccount classAccount) {
        classAccountMapper.addClassAccount(classAccount);
    }

    @Override
    public void deleteClassAccountById(int id) {
        classAccountMapper.deleteClassAccountById(id);
    }

    @Override
    public void updateClassAccountById(ClassAccount classAccount, int id) {
        classAccount.setId(id);
        classAccountMapper.updateClassAccountById(classAccount);
    }

    @Override
    public List<ClassAccount> queryClassAccountByClassId(String classCode) {
        return classAccountMapper.queryClassAccountByClassId(classCode);
    }
}
